package com.schooleducation.dao.impl;

import java.io.Serializable;
import java.util.List;

import com.schooleducation.dao.ExamDictinoaryDao;

public class ExamDictinoaryDaoImpl<T, PK extends Serializable> extends GenericDaoImpl<T, PK>implements ExamDictinoaryDao<T, PK> {

	@Override
	public List<T> getExamDictinoary(T entity, int start, int limit) {
		String hql="from ExamDictinoary exam inner join fetch exam.examDicResult where exam.lessonType = :lessonType";
		
		return super.findAll(hql, entity, start, limit);
	}
	
	@Override
	public List<T> getExamDictByExam(String examId) {
		String hql="select distinct(exam) from ExamDictinoary exam left join fetch exam.examDicResult where exam.id in ("+examId+")";
		return findAll(hql, 0, 30);
	}
}
